
//
//
//	NadineCamera.h
//
//

namespace Nadine
{
	
	//--------------------------------------------------------------------------------------
	//
	// NDCameraNavigator
	//
	//--------------------------------------------------------------------------------------
	class NDCameraNavi :public NDCustomModule
	{
	private:
		//int					m_nNaviModelList;
		//int					m_nNaviModelListSelectMode;
		
		NDOrbitCamera*		m_pCamera;			//src camera
		NDOrbitCamera*		m_pMyCamera;		//dst camera

		RECT				m_rcNavigatorRect; //screen coordinate
		GLUquadricObj*		m_pReusableQuadric; //A Reusable gluQuadric object:
		RECT				m_rcDrag;
		int					m_nCurrentButtonMask;
		bool				m_bMouseMButtonDown;
		bool				m_bMouseLButtonDown;
		bool				m_bMouseRButtonDown;
		int					m_nCurrState;
		bool				m_invUp;

		int					m_nBasicGeoCubeResId;
		int					m_nBasicGeoCylinerResId;

		bool				m_bInitialized;

	protected:
		void	SelectObject(int nX, int nY);
		void	drawCylinder(float fRad, float fHeight);
		void	GenNavigatorModel(bool bSelect);

	public:
		NDCameraNavi() :NDCustomModule(ND_CMCBWIN|ND_CMCBMOUSE)
		{
			this->m_pStrModuleName ="NDCameraNavi";
			m_bInitialized =false;

			m_invUp = false;
			m_pCamera = NULL;
			m_pMyCamera =0;
			m_nCurrentButtonMask = NULL;
		}
		virtual ~NDCameraNavi()	{}

		//COMMON FUNC.
		virtual bool	privateInit();
		virtual bool    publicInit();
		virtual void	release();

		virtual long	windowMessageProc(bool bMaximumWin, bool bMinimumWin, bool bRestoreWin, bool bSizeChanged);
		virtual long	mouseMessageProc(bool bLButtonDown, bool bRButtonDown, bool bMButtonDown, int nWheelDelta, int xPos, int yPos);
		virtual void	render(float fElapsedTime) {drawNavigator();}

		void	GenBasicGeo();

		void	SetObjCamera(NDOrbitCamera* pOrbitCamera);
		void	SetNavigatorPosi(const int nX, const int nY); //screen coordinate

		int		drawNavigator(bool bSelectMode = false, unsigned int* hitsBuff = NULL, int nX =0, int nY =0);


	};



}